﻿@model IEnumerable<EventModel>
@{
    ViewBag.Title = "真爱活动";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var user = ViewBag.User as User;
}

@section Direct{
    @if (user.IsAdministrator())
    {
        <div class="adr">
            <ul>
                <li>@Html.ActionLink("新建活动", "Add", "Event")
                </li>
                <li>@Html.ActionLink("活动类别管理", "Index", "Category")
                </li>
            </ul>
        </div>
    }
}

<section class="ec-in">
    @foreach (var item in Model)
    {
        if (!item.IsHidden || user.IsAdministrator())
        {
        <div class="">
            <div class="media">
                <a href="/Event/Detail/@item.Id">
                    <div>
                        <img alt="" src="/Assets/Event/@item.Id/@(item.Cover).jpg" />
                    </div>
                </a>
            </div>
            <div class="text">
                <header>
                    <h3>@item.Title</h3>
                </header>
                <address>6月18日 和平广场半岛咖啡</address>
            </div>
        </div>
        }
    }
</section>
